<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/detail.css">
    <link rel="stylesheet" href="css/header.css">
    <link rel="stylesheet" href="css/searchnav.css">
    <link rel="stylesheet" href="css/footer.css">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
</head>
<body>
<div id="app">

    <div class="container-fluid">
        <!-- 头部导航 -->
        <section id="header">
            <div class="header-box">
                <div class="address">
                    <select>
                        <option>成都市</option>
                        <option>绵阳市</option>
                        <option>上海市</option>
                        <option>深圳市</option>
                    </select>
                </div>
                <div class="nav">
                    <ul>
                        <li><a href="login.html">请登录 &ensp;/</a></li>
                        <li><a href="register.html">注册 &ensp;/</a></li>
                        <li><a href="#">签到有礼 &ensp;/</a></li>
                        <li><a href="#">我的订单 &ensp;/</a></li>
                        <li><a href="#">我的特卖 &ensp;/</a></li>
                        <li><a href="#">会员俱乐部 &ensp;/</a></li>
                        <li><a href="#">客服服务 &ensp;/</a></li>
                        <li><a href="#">手机版 &ensp;/</a></li>
                        <li><a href="#">更多</a></li>
                    </ul>
                </div>
            </div>
        </section>
        <!-- 搜索框+导航栏 -->
        <section id="search-nav">
            <div class="search-nav-box">
                <div class="serach">
                    <div class="logo" style="flex: 1;">
                        <img src="img/logo.png" alt="">
                    </div>
                    <div class="adver" style="flex: 2;">
                        <img src="img/advertising.jpg"/>
                    </div>
                    <div calss="serach-border" style="flex: 2;">
                        <div class="serach-box">
                            <div>
                                <input type="text" placeholder="6.16户外运动日">
                            </div>

                            <div class="btns">
                                搜索
                            </div>
                        </div>
                    </div>
                    <div class="shop-cart" style="flex: 1;">
                        <div class="shop-cart-btn">
                            <a href="#">购物车</a>
                        </div>
                    </div>
                </div>
                <div class="navbars">
                    <div class="active">商品分类</div>
                    <div>推荐</div>
                    <div>3折疯抢</div>
                    <div>唯品快抢</div>
                    <div>唯品奥莱</div>
                    <div>女装</div>
                    <div>运动</div>
                    <div>鞋包</div>
                    <div>美妆</div>
                    <div>母婴</div>
                    <div>电器</div>
                    <div>男装</div>
                    <div>内衣</div>
                    <div>更多</div>
                </div>
            </div>

        </section>
        <hr style="margin: 5px;"/>

        <!-- 详情 -->
        <section id="detail">
            <div class="detail-box">
                <div class="goods-pic"><img
                        :src="product.picPath"
                        alt="" style="width:420px; height: 420px"></div>
                <div class="goods-detail">
                    <h5>{{product.info}}</h5>
                    <div class="price">
                        <h3>￥{{product.price}}</h3>
                        <h5 style="text-decoration: line-through;color: #ccc;">￥230</h5>
                    </div>
                    <br/>
                    <div class="peisong">
                        配送:&ensp;&ensp;<select>
                        <option>请选择配送地址</option>
                        <option>四川省成都市吉利学院</option>
                        <option>四川省成都市东部新区</option>
                        <option>四川省成都市简阳市石盘镇</option>
                    </select>
                    </div>
                    <br/>
                    <div class="peisong">
                        <p>运费：新会员专享首单满38元免邮（限唯品自营商品，部分商品不可用）</p>
                    </div>
                    <br/>
                    <div class="peisong">

                        <div class="num">
                            <div class="title">
                                数量：
                            </div>
                            <div class="dec" @click="num--">-</div>
                            <div><input type="text" v-model="num"></div>
                            <div class="add" @click="num++">+</div>
                        </div>
                    </div>
                    <br/>
                    <br/>
                    <div class="peisong">
                        <button type="button" class="btn btn-danger">立即购买</button>
                        &ensp;
                        <button type="button" class="btn btn-warning" @click="toshartcart">加入购物车</button>
                    </div>
                </div>

            </div>
        </section>
        <!-- 底部 -->
        <div class="login-footer" style="margin-top: 60px;">
            <div>
                <img style="display:block;margin: 0 auto;"
                     src="https://shop.vipstatic.com/img/common/footer_common_20200705-hash-2a8e96cf.png" alt="">
            </div>
            <div style="display: flex; text-align: center; margin-top: 50px;">
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
            </div>
            <div class="txt" style="text-align: center; margin-top: 20px;">
                <p>Copyright © 2008-现在 vip.com，All Rights Reserved 使用本网站即表示接受 唯品会用户协议。版权所有 广州唯品会电子商务有限公司</p>
                <p>粤公网安备 44010302111111号 粤ICP备08114786号 增值业务经营许可证：粤B2-20170777 网络文化经营许可证：粤网文〔2021〕2056-282号</p>
                <p>经营主体证照 风险监测信息 互联网药品信息服务资格证书：（粤）-经营性-2018-0271 网络食品交易第三方平台备案凭证：粤B2-20170777 医疗器械网络交易服务第三方平台备案
                </p>
                <p>凭证：（粤）网械平台备字[2019]第00001号 出版物网络交易平台服务经营备案证：粤新出网备（2021）1号 未成年人关怀专区</p>
                <p>违法和不良信息举报电话：4006789888 算法推荐违规举报电话：4006789888</p>
            </div>

        </div>
    </div>
</div>
<script>
    const App = {
        data() {
            return {
                num: 1,
                product: {}

            }
        },
        mounted() {
            axios({
                url: 'http://localhost:8080/shopping_war/detail'
            }).then(res => {
                this.product = res.data;
                console.log(this.product)
            })

        },
        methods: {
            todetail() {
                window.location.href = "http://localhost:8080/shopping_war/detail.html"
            },
            toshartcart() {
                window.location.href = "http://localhost:8080/shopping_war//add_to_car?pid=" + this.product.id + "&count=1"
            }
        }
    }
    Vue.createApp(App).mount('#app')
</script>
</body>
</html>
